<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/category.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
    <div class="content">
      <div id="tabs" class="htabs">
		<a href="#tab-general"><?php echo $tab_general; ?></a>
	  </div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
        <div id="tab-general">
          <div id="languages" class="htabs">
            <?php foreach ($languages as $language) { ?>
            <a href="#language<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
            <?php } ?>
          </div>
          <?php foreach ($languages as $language) { ?>
          <div id="language<?php echo $language['language_id']; ?>">
            <table class="form">
              <tr>
                <td><span class="required">*</span> <?php echo $entry_name; ?></td>
                <td><input type="text" name="roll[<?php echo $language['language_id']; ?>][name]" size="100" value="<?php echo isset($roll[$language['language_id']]) ? $roll[$language['language_id']]['name'] : ''; ?>" />
                  <?php if (isset($error_name[$language['language_id']]['name'])) { ?>
                  <span class="error"><?php echo $error_name[$language['language_id']]['name']; ?></span>
                  <?php } ?></td>
			</tr><tr>
				<td><span class="required">*</span> <?php echo $entry_href; ?></td>
                <td>http://<input type="text" name="roll[<?php echo $language['language_id']; ?>][href]" size="100" value="<?php echo isset($roll[$language['language_id']]) ? $roll[$language['language_id']]['href'] : ''; ?>" />
                  <?php if (isset($error_name[$language['language_id']]['href'])) { ?>
                  <span class="error"><?php echo $error_name[$language['language_id']]['href']; ?></span>
                  <?php } ?></td>
              </tr>
			 <tr>
              <td><?php echo $entry_target; ?></td>
              <td><select name="roll[<?php echo $language['language_id']; ?>][target]">
                 <?php if(isset($roll[$language['language_id']]) && (int)$roll[$language['language_id']]['target']==1){ ?>
                  <option value="1" selected="selected"><?php echo $text_published; ?></option>
                  <option value="0"><?php echo $text_published_not; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_published; ?></option>
                  <option value="0" selected="selected"><?php echo $text_published_not; ?></option>
                  <?php } ?>
                </select></td>
            </tr>
			<tr>
				<td><?php echo $entry_sort_order; ?></td>
				<td><input type="text" name="roll[<?php echo $language['language_id']; ?>][sort_order]" value="<?php echo isset($roll[$language['language_id']]) ? $roll[$language['language_id']]['sort_order'] : ''; ?>" size="1" /></td>
            </tr>
            <tr>
              <td><?php echo $entry_published; ?></td>
              <td><select name="roll[<?php echo $language['language_id']; ?>][published]">
                 <?php if(isset($roll[$language['language_id']]) && (int)$roll[$language['language_id']]['published']==1){ ?>
                  <option value="1" selected="selected"><?php echo $text_published; ?></option>
                  <option value="0"><?php echo $text_published_not; ?></option>
                  <?php } else { ?>
                  <option value="1"><?php echo $text_published; ?></option>
                  <option value="0" selected="selected"><?php echo $text_published_not; ?></option>
                  <?php } ?>
                </select></td>
            </tr>
            </table>
          </div>
          <?php } ?>
        </div>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript"><!--
$('#tabs a').tabs(); 
$('#languages a').tabs();
//--></script> 
<?php echo $footer; ?>